﻿Imports System.IO

Module ClearVmware

    Sub Main()

        Console.WriteLine("Clear,Y or N?")

        Dim str As String = Console.ReadLine
        If str.ToLower = "y" Then
            Dim ic As IClear = New ClearFile

            Dim currentDir As String = Util.GetCurrentDir
            If Directory.Exists(currentDir) Then
                Dim dif As New DirectoryInfo(currentDir)

                Dim difs() As DirectoryInfo = dif.GetDirectories("*.*", SearchOption.AllDirectories)
                For index As Integer = 0 To difs.Length - 1
                    ic.CrearDir(difs(index))
                Next

                Dim fifs() As FileInfo = dif.GetFiles("*.*", SearchOption.AllDirectories)
                For index As Integer = 0 To fifs.Length - 1
                    ic.ClearFile(fifs(index))
                Next
            End If

            Console.WriteLine("Clear Completed ")
            Console.WriteLine("Press any Key Quit")
            Console.ReadLine()

        End If
        
    End Sub

End Module
